<template>
<div>
    <el-dialog :title="title" :visible.sync="dialogFormVisble" :close-on-click-modal="false" @close="closeDialog">
        <el-form :model="selectTable" :rules="rules" ref="selectTable" size="small" label-width="150px">

          <el-form-item v-if="addEqu" label="选择设备类型：" prop="type">
            <el-radio v-model="selectTable.type" label="1">电盒</el-radio>
            <el-radio v-model="selectTable.type" label="2">网盒</el-radio>
          </el-form-item>

          <el-form-item v-if="addEqu" label="设备类型：" :required="true" prop="mode">
            <el-select v-model="selectTable.mode" placeholder="设备类型">
              <el-option key="1" label="广东省" value="广东省"></el-option>
              <el-option key="2" label="湖南省" value="湖南省"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item v-if="addEqu" label="设备ID：" :required="true" prop="id">
            <el-input v-model="selectTable.id" placeholder="请输入设备ID"></el-input>
          </el-form-item>

          <el-form-item v-if="addEqu" label="设备名称：" :required="true" prop="name">
            <el-input v-model="selectTable.name" placeholder="请输入设备名称"></el-input>
          </el-form-item>

          <el-form-item v-if="addEqu" label="设备MAC：" prop="mac">
            <el-input v-model="selectTable.mac" placeholder="请输入设备MAC"></el-input>
          </el-form-item>

          <el-form-item v-if="!addEqu" label="选择所属商户：" :required="true" prop="mode">
            <el-select v-model="selectTable.mode" placeholder="选择所属商户">
              <el-option key="1" label="广东省" value="广东省"></el-option>
              <el-option key="2" label="湖南省" value="湖南省"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item v-if="!addEqu" label="选择设备厂家：" :required="true" prop="manufactor">
            <el-select v-model="selectTable.mode" placeholder="选择所属商户">
              <el-option key="1" label="广东省" value="广东省"></el-option>
              <el-option key="2" label="湖南省" value="湖南省"></el-option>
            </el-select>
          </el-form-item>

          <el-form-item v-if="!addEqu" label="请选择出厂日期：" prop="date" :required="true">
            <el-date-picker type="date" placeholder="选择日期" v-model="selectTable.date" value-format="yyyy-MM-dd" style="width: 100%"></el-date-picker>
          </el-form-item>

          <el-form-item v-if="!addEqu" label="请输入生产批次：" prop="batch" :required="true">
            <el-input v-model="selectTable.batch" placeholder="请输入生产批次"></el-input>
          </el-form-item>

        </el-form>

        <div slot="footer" class="dialog-footer">
          <el-button v-if="addEqu" @click="dialogFormVisble = false">取 消</el-button>
          <el-button type="primary" v-if="addEqu" @click="nextStep()">下一步</el-button>
        </div>
      </el-dialog>
       <bcycle-finished ref="cycleFinishRef" v-if="bcycleFinishDialog.show" :isShow="bcycleFinishDialog.show"  @closeDialog="hideBcycleFinishDialog" title="批量配置周期"></bcycle-finished>
</div>
</template>
<script>
import BcycleFinished from '@/components/dialog/bCycleFinish'
export default {
    data() {
        return {
            dialogFormVisble: this.isShow,
            bcycleFinishDialog: {show: false},
            selectTable: {
                type: '1'
            },
            addEqu: true,
            rules: {
                type: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
                mode: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
                name: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
                id: [{ required: true, message: '请输入设备ID', trigger: 'blur' }],
                manufactor: [{ required: true, message: '请输入设备厂家名称', trigger: 'blur' }],
            }
        }
    },
    components: {BcycleFinished},
    props:['isShow', 'title'],
    methods: {
        //设置弹窗可见
        closeDialog() {
            this.$emit('closeDialog')
        },
        updateDevice() {
            this.dialogFormVisble = true
            this.title = '修改设备'
        },
        hideBcycleFinishDialog() {
            this.bcycleFinishDialog.show = false
        },
        confirmDialog() {},
        nextStep() {
          this.bcycleFinishDialog.show = true
        }
    }
}
</script>
<style lang="less" scoped>

</style>

